package autogen;

<%@page import="static hh.EmptyUtil.*,hh.*" %>
<%String doName = toCamelCaseRemovePreAndSuffix(table.tableName, "st", "1");%>

import autogen.domain.<%=doName%>DTO;
import autogen.domain.<%=doName%>PageDTO;
import dto.Payload;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;
import java.util.List;

/**
 * <%=table.tableName%>表 api接口
 * @author mybatis-orm auto generator
 */
@RequestMapping("/root")
public interface <%=doName%>Api{

    @PostMapping("/create")
    Payload<Boolean> create(@RequestBody @Valid <%=doName%>DTO entity);
    
    @PostMapping("/createBatch")
    Payload<Boolean> createBatch(@RequestBody @Valid List<<%=doName%>DTO> entities);
    
    @PostMapping("/deleteById/{id}")
    Payload<Boolean> deleteById(@PathVariable("id") Long id);
    
    @PostMapping("/deleteBatchByIds")
    Payload<Boolean> deleteBatchByIds(@RequestBody List<Long> ids);
    
    @PostMapping("/delete")
    Payload<Boolean> delete(@RequestBody <%=doName%>DTO entity);
    
    @GetMapping("/findById/{id}")
    Payload<<%=doName%>DTO> findById(@PathVariable("id") Long id);
    
    @PostMapping("/listPage")
    Payload<List<<%=doName%>DTO>> listPage(@RequestBody @Valid <%=doName%>PageDTO query);
    
    @PostMapping("/list")
    Payload<List<<%=doName%>DTO>> list(@RequestBody <%=doName%>DTO query);
    
    @PostMapping("/findOne")
    Payload<<%=doName%>DTO> findOne(@RequestBody <%=doName%>DTO query);
    
    @PostMapping("/updateById")
    Payload<Boolean> updateById(@RequestBody <%=doName%>DTO entity);
    
    @PostMapping("/updateBatchById")
    Payload<Boolean> updateBatchByIds(@RequestBody List<<%=doName%>DTO> entities);
}
